function setTab(name,cursel,n){
for(i=1;i<=n;i++){
var menu=document.getElementById(name+i);/* two1 */
var con=document.getElementById("con_"+name+"_"+i);/* con_two_1 */
menu.className=i==cursel?"on":"";
con.style.display=i==cursel?"block":"none";
}
}




function browserRedirect() {
	var sUserAgent = navigator.userAgent.toLowerCase();
	var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
	var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
	var bIsMidp = sUserAgent.match(/midp/i) == "midp";
	var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
	var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
	var bIsAndroid = sUserAgent.match(/android/i) == "android";
	var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
	var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
	if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) {
	//phone
	} else {

	//pc

	var oUrl=window.location.href;

	var subStr=new RegExp('m');

	if(oUrl.indexOf('ceshi')<0){

		var result=oUrl.replace(subStr,"www");

		window.location=result;

	}

	

	}

}

if(window.location.hash=='#wap'){}else{browserRedirect();} 


			
			function createSwiper(index){
				  var mySwiper = new Swiper ('.swiper-container'+index, {
						loop: true,
						autoplay: true,
						slidesPerView: "auto",
						centeredSlides:true,
						pagination: {
									el: '.swiper-pagination'+index,
									clickable: true,
									renderBullet: function (index, className) {
									  return '<span class="' + className + '">' + (index + 1) + '</span>';
									},
								  },
						lazy: {
							loadPrevNext: true,
						},
						observer:true,
						observeParents:true,
						autoplayDisableOnInteraction : false,
						autoplay:{
							enabled: true,
							delay: 3000,
							disableOnInteraction: false,
						},
					});
				  return mySwiper;  
			}
			






$(function () {
	
	
if ($(".swiper-container0").length > 0){  
			
			createSwiper(0)

}
	
 // 手机导航
    $('.menuBtn').append('<b></b><b></b><b></b>');
    $('.menuBtn').click(function(event) {
        $(this).toggleClass('open');
        var _winw = $(window).width();
        var _winh = $(window).height();
        if ($(this).hasClass('open')) {
            $('body').addClass('open');
            $('.caidan').animate({
                right: '0'
            }, 500)
        } else {
            $('body').removeClass('open');
            $('.caidan').animate({
                right: '-200%'
            }, 500)
        }
    });

	
	
	
	
var bodyWidth = jQuery(window).width();	
if(bodyWidth <= 768){	
$(".caidan ul>li.yj>a").each(function(){
				$(this).append('<span class="explose"><i class="icon"></i></span>');
			
			
	$(this).find('.explose').click(function(){
					console.log(1);
					$(this).find(".icon").addClass("icon-arrow-up");
					var sub = $(this).parent().next();
					
				$(".caidan .icon").removeClass("icon-arrow-up");

					
				$(this).find(".icon").addClass("icon-arrow-up");
				 //	$(".navbar .sub").removeClass("show");
				 	
				 		
				 if(sub.hasClass("show")){
						sub.removeClass("show");
					}else{
					    $(".caidan .sub").removeClass("show");
						sub.addClass("show");
					}		
				 		
				 		
				 		
				 		
				 		
					return false;
				});		
			
			
			});		
			
	
}	
	
	
	
	
	
	
	
	
		$(".btn-top").click(function() {
		$("html, body").animate({
			"scroll-top": 0
		}, "fast");
	});
///////////

	$(window).scroll(function() { //bug
		var _top = $(window).scrollTop();
		if (_top > 200) {
			$(".btn-top").slideDown();
		} else {
			$(".btn-top").slideUp();
		}
		
	});
	
/////////
	

	
	
	  $(".zb li").click(function(){
var e = $(this).index();
$(this).siblings().removeClass("on"),
$(this).addClass("on"),
$(".matchb").css("display",'none');
$(".matchb:eq(" + e + ")").css("display",'block');
});
	
	
	

 	
///////////////	
	
	
var streamBtm='<a href="https://tv.cctv.com/live/cctv5/" target="_blank"><p title="CCTV5">CCTV5</p></a><a href="https://www.zhibo8.com/" target="_blank"><p title="文字直播">文字直播</p></a><a href="https://live.titan007.com/" target="_blank"><p class="link-hide" title="比分直播" style="display: none;">比分直播</p></a><a href="https://live.leisu.com/" target="_blank"><p class="link-hide" title="动画直播" style="display: none;">动画直播</p></a><a href="https://sports.qq.com/kbsweb/" target="_blank"><p class="link-hide" title="腾讯体育" style="display: none;">腾讯体育</p></a><a href="https://www.miguvideo.com/p/schedule/" target="_blank"><p class="link-hide" title="咪咕体育" style="display: none;">咪咕体育</p></a><a href="https://sports.iqiyi.com/" target="_blank"><p class="link-hide" title="爱奇艺体育" style="display: none;">爱奇艺体育</p></a><a href="https://www.ppsport.com/" target="_blank"><p class="link-hide" title="PP体育" style="display: none;">PP体育</p></a><a href="https://sports.sina.com.cn/" target="_blank"><p class="link-hide" title="新浪体育" style="display: none;">新浪体育</p></a>';
$(".streamBtm").append(streamBtm);
///////////////////	
$(".viewMore").click(function () {
if ( $(this).hasClass("show"))
{
$(this).removeClass("show");
$(this).text("更多");
$(this).prev().find('.link-hide').css("display",'none');
}
 else
{
$(this).addClass("show").siblings().removeClass("show");
$(this).text("收起");
$(this).prev().find('.link-hide').css("display",'block');
}
});	
///////////	



$(".zxsy .xxk li").hover(function(){
var e = $(this).index();
$(this).siblings().removeClass("on"),
$(this).addClass("on"),
$(".zxsy .huatir").addClass("hide"),
$(".zxsy .huatir:eq(" + e + ")").removeClass("hide")
});
/////////////

$(".zxjj .xxk li").hover(function(){
var e = $(this).index();
$(this).siblings().removeClass("on"),
$(this).addClass("on"),
$(".zxjj .huatir").addClass("hide"),
$(".zxjj .huatir:eq(" + e + ")").removeClass("hide")
});
/////////////


$(".zxlx  .xxk li").hover(function(){
var e = $(this).index();
$(this).siblings().removeClass("on"),
$(this).addClass("on"),
$(".zxlx  .huatir").addClass("hide"),
$(".zxlx  .huatir:eq(" + e + ")").removeClass("hide")
});
/////////////


$(".zxsp  .xxk li").hover(function(){
var e = $(this).index();
$(this).siblings().removeClass("on"),
$(this).addClass("on"),
$(".zxsp  .vlist").addClass("hide"),
$(".zxsp  .vlist:eq(" + e + ")").removeClass("hide")
});
/////////////


$(".qiudui li").hover(function(){
var e = $(this).index();
$(this).siblings().removeClass("on"),
$(this).addClass("on"),
$(".qlist").addClass("hide"),
$(".qlist:eq(" + e + ")").removeClass("hide")
});
/////////////


$(".tyss .xxk li").hover(function(){
var e = $(this).index();
$(this).siblings().removeClass("on"),
$(this).addClass("on"),
$(".tyss .itemp").addClass("hide"),
$(".tyss .itemp:eq(" + e + ")").removeClass("hide")
});
/////////////


$(".tyss2 .xxk li").hover(function(){
var e = $(this).index();
$(this).siblings().removeClass("on"),
$(this).addClass("on"),
$(".tyss2 .itemp").addClass("hide"),
$(".tyss2 .itemp:eq(" + e + ")").removeClass("hide")
});
/////////////

	
});




 